package com.dzh.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.View;
import org.springframework.web.servlet.ViewResolver;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

import java.util.Locale;

/**
 * 自定义(diy)配置视图解析器
 * 建议使用自己写的MyMvcConfig2类
 */
@Configuration
//@EnableWebMvc  全面接管springmvc
public class MyMvcConfig implements WebMvcConfigurer {

    @Bean
    public ViewResolver ViewResolver(){
        return  new MyViewResolver();
    }


    public  static  class  MyViewResolver implements ViewResolver {
        @Override
        public View resolveViewName(String s, Locale locale) throws Exception {
            return null;
        }
    }


}
